package com.b2bpsssm.controller.sysmanage;/**
 * @author JunYu
 * @create 2022-08-14--15:03
 */

import com.b2bpsssm.common.R;
import com.b2bpsssm.simulate.GenerateSysRole;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

/**
 * @program: B2BPSSMSystem
 * @description: 权限管理控制器
 * @author: JunYu
 * @create: 2022-08-14 15:03
 **/
@EnableSwagger2
@Controller
@RequestMapping("/permission")
@Api(value = "权限管理", tags = "权限管理api")
public class SysMenuController {
    //查询所有权限
    @RequestMapping(value = "/findAllPermission",method = RequestMethod.GET)
    @ResponseBody
    //Swagger配置
    @ApiOperation(value = "查询所有权限", notes = "查询所有权限，直接传回所有权限", httpMethod = "get", response =R.class)
    public R findAllPermission() {
        R r = new R();
        r.setCode(200);
        r.setMassage("查询所有权限成功");
        return r;
    }

    //通过权限id查询权限
    @RequestMapping(value = "/findPermissionById",method = RequestMethod.GET)
    @ResponseBody
    //Swagger配置
    @ApiOperation(value = "通过权限id查询权限", notes = "通过权限id查询权限，要求传入权限id", httpMethod = "get", response =R.class)
    @ApiImplicitParams(
            {
                    @ApiImplicitParam(name = "id", value = "权限id", paramType = "int", dataType = "String", required = true)
            }
    )
    public R findPermissionById(@RequestParam("id") int id) {
        R r = new R();
        r.setCode(200);
        r.setMassage("根据id查权限");
        return r;
    }
}
